UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'igO0vMw8O55TyUy8ni5+323ODEzy2wUPCtbeAmo9HpM='
WHERE
key_id = '3a8640360e16d39b64273f47beec82e1d0f89b33493198ce3529fc58f89cf51d'
AND (
token = 'igO0vMw8O55TyUy8ni5+323ODEzy2wUPCtbeAmo9HpM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)