UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2MU7wdu22ag8296UQLMZfgJdhOsuQB8aA+XTFSfiOok='
WHERE
key_id = '118a5c681aa23565602dafef7ad051b10c23d9301cf046004551f52a8404060d'
AND (
token = '2MU7wdu22ag8296UQLMZfgJdhOsuQB8aA+XTFSfiOok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)