UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ilx8h8so7FaxlBWdKL5ihEECVNp+rJMOg44UNu25oU='
WHERE
key_id = '9c84494cedc50bfacac74386b72c0871f0aa73cf6f569dfdebabcc99a826941e'
AND (
token = '3ilx8h8so7FaxlBWdKL5ihEECVNp+rJMOg44UNu25oU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)