UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0eHIWt0ktv6BVLbLRo8nID9hbjIHqnlrESw/R7gMBdY=' 
WHERE 
  key_id = '055d21b475044a3e4fb1eff1f948b705207e9229461222eae5d9791cce173e18' 
  AND (
    token = '0eHIWt0ktv6BVLbLRo8nID9hbjIHqnlrESw/R7gMBdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040