UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zKm/a60mxhKma6rFh7znb7qzlkhPPnYQwI6jIqVPKK4=' 
WHERE 
  key_id = 'f2e351c45c86de459a365d2a515e12e09bf394fd857cad53fc8812f87e3dc6e3' 
  AND (
    token = 'zKm/a60mxhKma6rFh7znb7qzlkhPPnYQwI6jIqVPKK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030