UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qqFFZ063upaKxxAGRC2jvfKvD72rbjLn15LChnSRgt4=' 
WHERE 
  key_id = '383a4f81ab5432258a1a15ef152cd07cecb67f0edff6153493091214c7f4ecfc' 
  AND (
    token = 'qqFFZ063upaKxxAGRC2jvfKvD72rbjLn15LChnSRgt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042