UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xuqUJKx8oLDykq15pAo579BcDgDeU7jD8eEUEKz9GXE='
WHERE
key_id = '9f8bbad2f37dc4bc341780395f529fb18eea215c4e50d804847909ab76269660'
AND (
token = 'xuqUJKx8oLDykq15pAo579BcDgDeU7jD8eEUEKz9GXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)