UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6omKZW3lG9m64AfGYbTue6jeGzooKcdRZS2bSurB5JI='
WHERE
key_id = 'c35400e86ac147263b4e023e21016ebb91fc8842dc08620d3c4fc8c4a8b51c37'
AND (
token = '6omKZW3lG9m64AfGYbTue6jeGzooKcdRZS2bSurB5JI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)