UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xy2V7PgcxVwp21TLB+dA2fvwU42L6TEnE1KpjapAHXE=' 
WHERE 
  key_id = 'cbce3e7b4317cbad9412c364abbc8b978beb4067a57130f5ae38bcdf4e6d86c2' 
  AND (
    token = 'Xy2V7PgcxVwp21TLB+dA2fvwU42L6TEnE1KpjapAHXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028