UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2s0NkqbKyDxpeVZoPxCQBIs6Z8D1jyEuIt3wRAC6oTA='
WHERE
key_id = '313cf30ad9a669ef9f0b393f359bf4bb4af5fd5a2d366d3d182a6e699120ae40'
AND (
token = '2s0NkqbKyDxpeVZoPxCQBIs6Z8D1jyEuIt3wRAC6oTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)