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

Query time 0.00027