UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PzZP98sw7kS5ZMYaLb1xMDo1PEBF73qxsXxRIrHyBmQ='
WHERE
key_id = 'a60c9eeadda6f9a2ef53197fc9395cdeca387ef4cf8903c32610e4f4ed87a37a'
AND (
token = 'PzZP98sw7kS5ZMYaLb1xMDo1PEBF73qxsXxRIrHyBmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)