UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wmSQSg8JTmhWZyKnHhFzr9nxhmPsfxANRVYFtR7FovU='
WHERE
key_id = 'eb55b56b60fb2b81b850b3e2c2a0142be12125fb8d218bd89f49cf790accb775'
AND (
token = 'wmSQSg8JTmhWZyKnHhFzr9nxhmPsfxANRVYFtR7FovU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)