UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y3CKAFpgwPxZ1gaIU3OsjemrZiXz8IpnA+gJwKmh2R0=' 
WHERE 
  key_id = '0d6d1a23f816cd19f0111f94b5791fb97498c151bf7735f307d65f01472efc07' 
  AND (
    token = 'Y3CKAFpgwPxZ1gaIU3OsjemrZiXz8IpnA+gJwKmh2R0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033