UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cNLXvjxBUVk33siK910Tfnhl/m25kiLVXkbSb/ViWPQ=' 
WHERE 
  key_id = '117e55c98664cc56a7e35fd5d80ac34477c492442d07e4a18c4fb16a57fa1a6e' 
  AND (
    token = 'cNLXvjxBUVk33siK910Tfnhl/m25kiLVXkbSb/ViWPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068