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