UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L2M6N+DuWvKF0lkr0FxCGNBIiv6oJmpodAqpOit+eeI='
WHERE
key_id = 'e085eeb0a4894ee9e2876920287d579fbb50be07b374f3b5cdbe42b6aa5a2f0c'
AND (
token = 'L2M6N+DuWvKF0lkr0FxCGNBIiv6oJmpodAqpOit+eeI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)