UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U6u/REDFOZMI5Q1NzwgqdekaCjnhjTJWeWfAs8luH2g='
WHERE
key_id = 'ebba9b9d515ecdbdb7c35c363c3a5ac811825c6e690a7991cf2c77dc95a176d3'
AND (
token = 'U6u/REDFOZMI5Q1NzwgqdekaCjnhjTJWeWfAs8luH2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)