UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G922NjWNMO0pF0Q0HB8T7nM4V5W7s8ErGRMPrY5a/64='
WHERE
key_id = 'cad3f8514e620354d33137b02d01eb1138df783e35c3995ad39359cff7fe0c7d'
AND (
token = 'G922NjWNMO0pF0Q0HB8T7nM4V5W7s8ErGRMPrY5a/64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)