UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tR3OWjqn+ykmwoSUowpkBmzyNwN0CD/jHG6RP8cl3MQ='
WHERE
key_id = '1d254460c78b78f8913faba431f8a763609c25aa1ecfe9d6da6fe26f40493423'
AND (
token = 'tR3OWjqn+ykmwoSUowpkBmzyNwN0CD/jHG6RP8cl3MQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)