UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u373m3G5Ei3CVrnwEsssKYRh2DSAFySaVDBtZdw5o+E=' 
WHERE 
  key_id = 'b38d4164db59b2555ecf7034da588c8ac84c7c19ad12e9f59ed423df677d4855' 
  AND (
    token = 'u373m3G5Ei3CVrnwEsssKYRh2DSAFySaVDBtZdw5o+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051