UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9xb1tljuf0Rl/lxV226k61YRuqPzWZnbZtjw9dksPqo='
WHERE
key_id = 'f8107b30d7efdf529b02950131a39373889716b300e705f6825788aeeff3dffb'
AND (
token = '9xb1tljuf0Rl/lxV226k61YRuqPzWZnbZtjw9dksPqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)