UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LT19TSq/5x7w/OQ/uZCQ6KWEVGGiM+HsKQ0bS8uudQw=' 
WHERE 
  key_id = 'e0f3347a01185d28212ace9fb74ed7505d506f310455bceead2ac13072df7e73' 
  AND (
    token = 'LT19TSq/5x7w/OQ/uZCQ6KWEVGGiM+HsKQ0bS8uudQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029