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