UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2uSueXkH3AfDXBGKbVLm2VbCpVs8vFWjRqPip5d870U='
WHERE
key_id = '0a78d114f4c344e4b6d6354a684003a36915771c0d83fc69c1b09aac1bcc1547'
AND (
token = '2uSueXkH3AfDXBGKbVLm2VbCpVs8vFWjRqPip5d870U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)