UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/cawvKSXOW9+ytOLjGRSqRmLW8wpcJaXBZP2DMqxLsg='
WHERE
key_id = '8fd1e4d59a49a8df43cb97925d04541ebb4f71701762b4b744960f5965d7edc4'
AND (
token = '/cawvKSXOW9+ytOLjGRSqRmLW8wpcJaXBZP2DMqxLsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)