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