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

Query time 0.00028